<template>
<div>
      <div>借款需求</div>
<div>
  <div>
<el-form ref="form"  label-width="80px" style="clear:both">
				<el-col :span="8">
					<el-form-item label="放款信息">
						<el-input  v-model="lenderinformation" placeholder="请输入放款人信息"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="开户机构">
						<el-input v-model="accountinginstitute" placeholder="请输入开户机构"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="付款账户">
						<el-input v-model="paymentaccount" placeholder="请输入付款账户"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="合同编号">
							<el-input  v-model="contractnumber" placeholder="请输入合同编号"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="签署日期">
						<el-date-picker
      v-model="value1"
      type="date"
      placeholder="选择日期">
    </el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="客户名称">
						<el-input  v-model="customername" placeholder="请输入客户名称"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="签署地址">
						<el-input  v-model="signingaddress" placeholder="请输入签署地址"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="借款金额">
						<el-input  v-model="loanamount" placeholder="请输入借款金额"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="产品名称">
					<el-input  v-model="productname" placeholder="请输入产品名称"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="还款方式">
						<el-input  v-model="repaymentmethod" placeholder="请输入还款方式"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="期限类型" prop="termtype">
						<el-input v-model="termtype"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="期限" prop="term">
						<el-input v-model="term"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="月利率" prop="monthlyrate">
						<el-input v-model="monthlyrate"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="8">
					<el-form-item label="手续费率" prop="processingfees">
						<el-input v-model="processingfees"></el-input>
					</el-form-item>
				</el-col>
        <el-col :span="8">
					<el-form-item label="违约利率" prop="defaultrate">
						<el-input v-model="defaultrate"></el-input>
					</el-form-item>
				</el-col>
        <el-col :span="8">
					<el-form-item label="借款主体" prop="borrower">
						<el-input v-model="borrower"></el-input>
					</el-form-item>
				</el-col>
        <el-col :span="16">
					<el-form-item label="借款用途" prop="usageloan">
						<el-input v-model="usageloan"></el-input>
					</el-form-item>
				</el-col>
        <el-col :span="8">
					<el-form-item label="邮箱" prop="email">
						<el-input v-model="email"></el-input>
					</el-form-item>
				</el-col>
			</el-form>
     </div> 
</div>
 <div>银行账户信息</div>
 
<div>
 <el-table :data="tableData" style="width: 100%" border height="150">
          <el-table-column type="index" label="序号" width="80">
          </el-table-column>
          <!-- <input type="hidden" value="bwid" prop="bwid" /> -->
          <el-table-column prop="bctype" label="账户类型" width="180">
          </el-table-column>
          <el-table-column prop="bcdeposit" label="开户银行" width="180"> </el-table-column>
           <el-table-column prop="bcBelonging" label="所属支行" width="180"> </el-table-column>
            <el-table-column prop="bcnumber" label="账号" width="180"> </el-table-column>
             <el-table-column prop="bctitle" label="账户名称" width="180"> </el-table-column>
              <el-table-column prop="bcremarks" label="备注" width="180"> </el-table-column>
              
               <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="contractinfo(scope.row)" type="text" size="small">添加</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
    </el-table-column>
        </el-table>
</div>
 <div>合同信息</div>
 
<div>
 <el-table :data="contractData" style="width: 100%" border height="150">
          <el-table-column type="index" label="序号" width="80">
          </el-table-column>
          <el-table-column prop="contractname" label="合同名称" >
          </el-table-column>
          <el-table-column prop="remarks" label="备注" > </el-table-column>
           <el-table-column prop="filesize" label="文件大小"> </el-table-column>
          
               <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="contractinfo(scope.row)" type="text" size="small">添加</el-button>
        <el-button type="text" size="small">编辑</el-button>
      </template>
    </el-table-column>
        </el-table>
</div>
<div style="margin-top:25px">
    <el-row >
  <el-button style="margin-top: 20px; margin-left:500px"  type="primary" @click="onSubmit">保存</el-button>
</el-row>
   
</div>
</div>
 
</template>

<script>

export default ({
    data(){
      return{
        lenderinformation:'',
        accountinginstitute:'',
        paymentaccount:'',
        contractnumber:'',
        
        customername:'',
        signingaddress:'',
        loanamount:'',
        productname:'',
        repaymentmethod:'',
        termtype:'',
        term:'',
        monthlyrate:'',
        processingfees:'',
        defaultrate:'',
        borrower:'',
        usageloan:'',
        email:'',
      tableData:[],
      contractData:[],
       value1: '',
      }

    },
    created(){
      this.init()
      this.information()
  },
  methods:{
    onSubmit(){
      this.$axios.post("http://localhost:8082/contract/addContract",{
        lenderinformation: this.lenderinformation,
        accountinginstitute: this.accountinginstitute,
        paymentaccount:this.paymentaccount,
        contractnumber:this.contractnumber,
        datesigning:this.datesigning,
        customername:this.customername,
        signingaddress:this.signingaddress,
        loanamount:this.loanamount,
        productname:this.productname,
        repaymentmethod:this.repaymentmethod,
        termtype:this.termtype,
        term:this.term,
        monthlyrate:this.monthlyrate,
        processingfees:this.processingfees,
        defaultrate:this.defaultrate,
        borrower:this.borrower,
        usageloan:this.usageloan,
        email:this.email

      }).then(r => {
        console.log("发送成功了的合同信息");
      });
      },
      init(){
      this.$axios.get("http://localhost:8082/bank/all", {
          
        })
        .then(resp => {
          this.tableData = resp.data.data;
          console.log(resp)
        });
      },
      information(){
        this.$axios.get("http://localhost:8082/contractinformation/all", {
          
        })
        .then(resp => {
          this.contractData = resp.data.data;
          console.log(resp)
        });
      },
      contractinfo(){

      }
  }
})
</script>

<style>

    
</style>
